< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03030303.xhp

(section: timer) (bookmark: bm_id3149346)
Timer function

Timer 関数

Timer Function [Runtime]
Timer 関数 [実行時](hd_id3149346.1)

Returns a value that specifies the number of seconds that have elapsed since midnight.
午前 0 時を基点とする経過時間を秒数で返します。(par_id3156023.2)

(/section: timer)
Note Icon 注マーク You must first declare a variable to call the Timer function and assign it the "Long " data type, otherwise a Date value is returned.
Timer 関数を呼び出す場合は、あらかじめ定義しておいた「ロング整数」型の変数に戻り値を返させる必要があります。そうでない場合は、時刻ではなく日付が返されます。(par_id3156212.3)

Syntax:
構文:(hd_id3153768.4)

Timer
Timer(par_id3161831.5)

Return value:
戻り値:(hd_id3146975.6)

Date
日付(par_id3146984.7)

Example:
例:(hd_id3156442.8)

Sub ExampleTimer
Sub ExampleTimer(par_id3153951.9)

Dim lSec as long,lMin as long,lHour as long
Dim lSec as long,lMin as long,lHour as long(par_id3147427.10)

lSec = Timer
lSec = Timer(par_id3153092.11)

MsgBox lSec,0,"Seconds since midnight"
MsgBox lSec,0,"Seconds since midnight"(par_id3145748.12)

lMin = lSec / 60
lMin = lSec / 60(par_id3149260.13)

lSec = lSec Mod 60
lSec = lSec Mod 60(par_id3148646.14)

lHour = lMin / 60
lHour = lMin / 60(par_id3148575.15)

lMin = lMin Mod 60
lMin = lMin Mod 60(par_id3150418.16)

MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0,"The time is"
MsgBox Right("00" & lHour , 2) & ":"& Right("00" & lMin , 2) & ":" & Right("00" & lSec , 2) ,0, "只今の時刻 "(par_id3156283.17)

end sub
end sub(par_id3153158.18)


< Prev / Next >